﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="LightControls.IPhoneButton"
	d:DesignWidth="640" d:DesignHeight="480">
	<UserControl.Resources>
		<Style x:Key="IPhoneButton" TargetType="ToggleButton">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ToggleButton">
                        <Border x:Name="LayoutRoot" CornerRadius="3" Width="80" Height="21" MaxWidth="80" MaxHeight="21">
                            <VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.5">
											<VisualTransition.GeneratedEasingFunction>
												<CircleEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Indeterminate"/>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="47.175" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="cnvMoving" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							
								<Canvas x:Name="cnvMoving" Height="20" Canvas.Left="-22" Width="144" Margin="-48,-1,-17,0" d:LayoutOverrides="VerticalAlignment" RenderTransformOrigin="0.5,0.5">
									<Canvas.RenderTransform>
										<CompositeTransform/>
									</Canvas.RenderTransform>
									<Rectangle Stroke="#FF999898" Height="20" Width="49" Canvas.ZIndex="1" StrokeThickness="0.5" Canvas.Left="78">
										<Rectangle.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FF979797"/>
												<GradientStop Color="#FFD6D6D6" Offset="0.233"/>
												<GradientStop Color="White" Offset="0.991"/>
												<GradientStop Color="#FFB6B6B6" Offset="0.073"/>
											</LinearGradientBrush>
										</Rectangle.Fill>
									</Rectangle>
									<Rectangle Stroke="#FF4377DE" Height="20" Width="50" StrokeThickness="0.5" Canvas.ZIndex="1">
										<Rectangle.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FF0059E9"/>
												<GradientStop Color="#FF79A7DC" Offset="0.599"/>
												<GradientStop Color="White" Offset="0.991"/>
											</LinearGradientBrush>
										</Rectangle.Fill>
									</Rectangle>
									<Rectangle Stroke="#FF858181" RadiusX="1.5" Height="20" Width="33" RadiusY="1.5" Canvas.ZIndex="3" Canvas.Left="47" StrokeThickness="0.5">
										<Rectangle.Fill>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFAFADAD"/>
												<GradientStop Color="#FFEBEBEB" Offset="0.586"/>
												<GradientStop Color="#FFFDFDFD" Offset="0.991"/>
											</LinearGradientBrush>
										</Rectangle.Fill>
									</Rectangle>
									<TextBlock Text="ON" TextWrapping="Wrap" Width="26" Foreground="#FFFBFBFB" Canvas.ZIndex="2" Canvas.Left="14" FontWeight="Bold" Canvas.Top="2"/>
									<TextBlock Text="OFF" TextWrapping="Wrap" Width="26" Foreground="#FF7C7C7C" Canvas.ZIndex="2" Canvas.Left="91" FontWeight="Bold" Canvas.Top="3"/>
								</Canvas>
                        </Border>
                    </ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="Foreground" Value="#FF908D8D"/>
		</Style>
	</UserControl.Resources>
	
	<ToggleButton x:Name="tgButton" Content="OFF" Height="20" Style="{StaticResource IPhoneButton}" Width="80"/>
					
</UserControl>